<%@ include file="/WEB-INF/jsp/include/skin_head.jsp" %><%@ page language="java" pageEncoding="UTF-8" %>
    <div id="pw_bbs" style="width: ${bbsType.bbsWidth}px;">
        <div id="pw_bbs_hader">${bbsType.bbsTopContent}</div>
        <div id="pw_bbs_body">
            
            <div id="pw_bbs_read">
                <div id="pw_bbs_read_header"></div>
                <table border="0" cellspacing="0" cellpadding="0" width="500">
                    <tbody>
                        <c:forEach items="${hierarchy}" var="child" varStatus="status">
                        <tr onmouseover="this.style.backgroundColor='#f1f6fb'" onmouseout="this.style.backgroundColor='#fefefe'">
                            <td align="left">
                                <a href="<c:url value="/bbs/view.do?bbsNo=${child.bbsNo}"/>">${child.title}</a>
                            </td>
                        </tr>
                        </c:forEach>
                    </tbody>
                </table>
                
                <div class="pw_bbs_read_box">
                    <div class="title">
                        ${bbs.title}
                    </div>
                    <div class="user">
                        <c:if test="${empty bbs.userNick}">
                        <label><spring:message code="bbs.userNick" /></label>
                        </c:if> 
                        ${bbs.userNick}
                        <c:if test="${not empty bbs.userEmail}">
                        <img src="<c:url value="/img/skin/default/i_email.gif" />" class="pw_bsc" />
                        <span class="email">${bbs.userEmail}</span>
                        <span class="pw_eml_red">@</span>
                        </c:if>
                        <c:if test="${not empty bbs.userHomepage}">
                        <img src="<c:url value="/img/skin/default/i_home.gif" />" class="pw_bsc" /> 
                        <span class="homepage">${bbs.userHomepage}</span>
                        </c:if>
                    </div>
                    <div>
                        <div class="url">
                            <a href="<c:url value="/article/" />${bbs.sid}" class="pw_gray"><spring:message code="DOMAIN" /><c:url value="/article/" />${bbs.sid}</a>
                        </div>
                        <div class="regdt">
                            ${bbs.registDate} ${bbs.registTime}
                            <br />
                        </div>
                    </div>
                    <div class="content">
                        <%-- pre${bbs.content}</pre--%>
                        ${bbs.content}
                    </div>
                    <c:forEach items="${bbs.fileList}" var="file" varStatus="status">
                    <div class="attach">
                        ${status.index + 1}. <a href="<c:url value="/download/" />${file.sid}"><b>${file.originalName}</b></a> ${file.fileSize} (${file.downloadCnt} <spring:message code="bbs.download" />)
                    </div>
                    </c:forEach>
                    <div class="moddt">
                        <em>${bbs.modifyDate} ${bbs.modifyTime}</em>
                        <br />
                        <em>${bbs.ip}</em>
                    </div>
                    <c:if test="${bbsType.rateYn == '1'}">
                    <div class="rate">
                        <img src="<c:url value="/img/skin/default/i_sum_up.gif" />" class="pw_bsc" /> <span id="rateUp" class="pw_fnt_out">Good</span>
                        <img src="<c:url value="/img/skin/default/i_sum_down.gif" />" class="pw_bsc" /> <span id="rateDown" class="pw_fnt_out">Bad</span>
                        <span class="pw_rte">
                            <span id="goodCnt">${bbs.goodCnt}</span>
                            (<span id="goodSum">${bbs.goodSum}</span><spring:message code="bbs.aperson" />)
                        </span>
                    </div>
                    </c:if>
                    <c:if test="${bbsType.starYn == '1'}">
                    <div class="star">
                        <img src="<c:url value="/img/skin/default/star_off.gif" />" class="pw_pointer" id="star1" />
                        <img src="<c:url value="/img/skin/default/star_off.gif" />" class="pw_pointer" id="star2" />
                        <img src="<c:url value="/img/skin/default/star_off.gif" />" class="pw_pointer" id="star3" />
                        <img src="<c:url value="/img/skin/default/star_off.gif" />" class="pw_pointer" id="star4" />
                        <img src="<c:url value="/img/skin/default/star_off.gif" />" class="pw_pointer" id="star5" />
                        <span class="pw_rte">
                            <span id="starCnt">${bbs.starCnt}</span><spring:message code="bbs.aperson" />
                            (<span id="starSum">${bbs.starSum}</span><spring:message code="bbs.point" />)
                        </span>
                    </div>
                    </c:if>
                    
                    <div class="seperate"></div>
        
                    <div class="memotag">
                        <strong>
                            <span id="memo" class="pw_fnt_out">
                                <spring:message code="bbs.memo" /> ${bbs.memoCnt}<spring:message code="bbs.apiece" />
                            </span>
                            |
                        </strong>
                        <strong>
                            <span class="pw_fnt_out">
                                <a href="<c:url value="/bbs/history.do?bbsId=${bbs.bbsId}&amp;bbsSid=${bbs.sid}&amp;categorySid=${param.categorySid}" />">history</a>
                            </span>
                        </strong>
                    </div>
        
                    <c:if test="${bbsType.memoYn == '1'}">
                    <div id="memoArea" class="memo">
                        <c:forEach items="${bbs.memoList}" var="memo" varStatus="status">
                        <c:if test="${not empty memo.content}">
                        <fieldset class="memofieldset" onmouseover="this.style.backgroundColor='#f1f6fb'" onmouseout="this.style.backgroundColor='#fefefe'">
                            <img src="<c:url value="/out/flags/${memo.userCountry}.png" />" class="pw_bsc" />
                            <strong>${memo.userNick}</strong><br />
                            <div class="content"><pre>${memo.content}</pre></div>
                            <span class="ip">
                                <img src="<c:url value="/img/skin/default/i_memo_re.gif" />" class="pw_bsc" title="<spring:message code="bbs.memoReply" />" onclick="memoInput('${memo.sid}', '${memo.depth}', 'REPLY');" />
                                <img src="<c:url value="/img/skin/default/i_memo_x.gif" />" class="pw_bsc" title="<spring:message code="bbs.memoRemove" />" onclick="memoRemove('${memo.sid}');" />
                                <img src="<c:url value="/img/skin/default/i_bad_off.gif" />" class="pw_bsc" title="<spring:message code="bbs.bad" />" />
                                ${memo.ip}
                            </span>
                            <span class="date" style="clear:both">${memo.registDate} ${memo.registTime}</span>
                        </fieldset>
                        </c:if>
                        </c:forEach>
                        <div id="dialog" title="Delete Memo">
                            <fieldset>
                                <label for="password"><strong><spring:message code="bbs.userPasswd" /></strong></label>
                                <input type="password" id="password" name="password" size="10" maxlength="16" />
                            </fieldset>
                        </div>
                        <div id="memoInput">
                            <fieldset class="showfieldset">
                            <sec:authorize ifNotGranted="ROLE_USER">
                                <label for="memoList0.userNick"><strong><spring:message code="bbs.userNick" /></strong></label> 
                                <input type="text" id="memoList0.userNick" name="memoList[0].userNick" size="10" maxlength="32" /> <form:errors path="memoList[0].userNick" />
                                <label for="memoList0.userPasswd"><strong><spring:message code="bbs.userPasswd" /></strong></label>
                                <input type="password" id="memoList0.userPasswd" name="memoList[0].userPasswd" size="10" maxlength="16" /> <form:errors path="memoList[0].userPasswd" />
                            </sec:authorize>
                            <sec:authorize ifAnyGranted="ROLE_USER">
                                <sec:authentication property="principal.username"/>
                            </sec:authorize>
                                <img src="<c:url value="/img/skin/default/btn_memo_save.gif" />" class="pw_pointer" onclick="editFormSubmit('frmBbs', 'content')" />
                            </fieldset>
                            <div id="SAGAEditorBox" style="width: ${(bbsType.bbsWidth - 4 - 20)}px; height: 225px; z-index: 0; position: relative;" class="WebEditor_box">
                                ${webEditor}
                                <textarea id="content" name="memoList[0].content" cols="75" rows="7" class="WebEditor" style="display: none"></textarea>
                            </div>
                            <!--div style="width: 718px; z-index: 0; position: relative;" class="WebEditor_box">
                                <form:textarea path="memoList[0].content" cols="75" rows="7" cssClass="WebEditor" />
                            </div-->
                        </div>
                    </div>
                    </c:if>
                </div>
                <div id="subMenuView">
                    <a href="<c:url value="/bbs/list/" />${bbs.bbsId}"><img src="<c:url value="/img/skin/default/btn_read_list.gif" />" class="pw_pointer" /></a>
                    <img id="addMemo" src="<c:url value="/img/skin/default/btn_read_memo.gif" />" class="pw_pointer" />
                    <a href="<c:url value="/bbs/edit.do?bbsId=${bbs.bbsId}&amp;categorySid=${category.sid}&amp;command=ADD" />"><img src="<c:url value="/img/skin/default/btn_read_write.gif" />" class="pw_pointer" /></a>
                    <a href="<c:url value="/bbs/reply.do?bbsNo=${bbs.bbsNo}&amp;categorySid=${category.sid}&amp;bbsId=${bbs.bbsId}&amp;command=REPLY" />"><img src="<c:url value="/img/skin/default/btn_read_reply.gif" />" class="pw_pointer" /></a>
                    <a href="<c:url value="/bbs/modify.do?bbsNo=${bbs.bbsNo}&amp;categorySid=${category.sid}&amp;bbsId=${bbs.bbsId}&amp;command=MODIFY" />"><img src="<c:url value="/img/skin/default/btn_read_update.gif" />" class="pw_pointer" /></a>
                    <a href="<c:url value="/bbs/remove.do?bbsNo=${bbs.bbsNo}&amp;categorySid=${category.sid}&amp;bbsId=${bbs.bbsId}&amp;command=REMOVE" />"><img src="<c:url value="/img/skin/default/btn_read_delete.gif" />" class="pw_pointer" /></a>
                    <img id="print" src="<c:url value="/img/skin/default/btn_read_print.gif" />" onclick="printPage('${bbs.bbsNo}');" class="pw_pointer" />
                </div>
            </div>
            
            <c:if test="${bbsType.listYn == '1'}">
            <div class="pw_bbs_read_list">
                <jsp:include page="../../../list.jsp" />
            </div>      
            </c:if>
    
        </div>
    </div>     